package com.fuchenyang.consumer.Service.Impl;

import com.fuchenyang.common.util.JsonResult;
import com.fuchenyang.consumer.Service.ConsumerService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@Service
public class ConsumerRibbonServiceImpl implements ConsumerService {
    @Resource
    private RestTemplate restTemplate;

    @Override
    public JsonResult a() {
        return restTemplate.getForObject("http://example-provider/provider/a", JsonResult.class);
    }


    @Override
    public JsonResult b(String name) {
        return restTemplate.getForObject("http://example-provider/provider/b/"+name, JsonResult.class);
    }
}
